package com.tools.s7.base;

import android.app.Application;

import com.tools.s7.exception.CrashHandler;
import com.tools.s7.exception.CrashHandlerData;
import com.tools.s7.listener.CrashHandlerListener;
import com.tools.s7.manager.AppManager;


public class BaseApplication extends Application implements CrashHandlerListener {

  /*  private static BaseApplication mInstance;
    public synchronized static BaseApplication getInstance() {
        return mInstance;
    }*/

    @Override
    public void onCreate() {
        super.onCreate();
//        mInstance = this;
        CrashHandler.getInstance().init(getApplicationContext(), this);
    }

    protected void onUploadLog(CrashHandlerData data) {
    }

    protected void onHandler() {
        AppManager.getAppManager().AppException(getApplicationContext());
    }

    @Override
    public void onException() {
        onHandler();
    }

    @Override
    public void onExceptionData(CrashHandlerData data) {
        onUploadLog(data);
    }


}
